package ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SaveJpanel extends JPanel implements ActionListener {
    private JButton btnSave;
    private JButton btnOff;

    private ATMJframe atmJframe;
    private Icon buttonSave = Util.getimagesIcon("/images/buttonSave.jpg");
    private Icon buttonOff = Util.getimagesIcon("/images/buttonOff.jpg");

    public SaveJpanel(ATMJframe atmJframe) {
        this.atmJframe = atmJframe;
        this.setLayout(null);
        this.setOpaque(false);
        btnSave = new JButton("", buttonSave);
        btnSave.setBounds(200, 150, 140, 50);
        this.add(btnSave);
        btnOff = new JButton("", buttonOff);
        btnOff.setBounds(850, 550, 140, 50);
        this.add(btnOff);
        btnOff.addActionListener(this);
    }


    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==btnOff){
            atmJframe.switchPanel("menu");
        }
    }
}
